﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Bot.Application.Dto;
using Bot.Application.Services;
using Microsoft.AspNetCore.Mvc;

namespace Bot.WebAPI.Controllers
{
    [Route("api/v3/agentAssist")]
    [ApiController]
    public class AgentAssistsController : ControllerBase
    {

        private readonly IAgentAssistAppService _app;
        public AgentAssistsController(IAgentAssistAppService app)
        {
            this._app = app;
        }

        [HttpGet]
        public ActionResult<AgentAssistDto> Get()
        {
            //int siteId = 10000;
            AgentAssistDto agentAssist = _app.Get();
            return Ok(agentAssist);
        }
        
        [HttpPut]
        public ActionResult<AgentAssistDto> Put([FromBody] AgentAssistUpdateDto dto)
        {
            //int siteId = 10000;
            AgentAssistDto agentAssist = _app.Update(dto);
            return Ok(agentAssist);
        }

        [HttpPost]
        public ActionResult<AgentAssistDto> Post([FromBody] AgentAssistCreateDto dto)
        {
            //int siteId = 10000;
            AgentAssistDto agentAssist = _app.Add(dto);
            return CreatedAtAction(nameof(Get), new { id = agentAssist.Id }, agentAssist);
        }
    }
}
